<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="format-detection" content="telephone=no">
    <meta name="msapplication-tap-highlight" content="no">
    <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
    <title>我的文章/评论/点赞</title>
    <link rel='stylesheet' href='<%- rootUrl %>/res/adapter.css' />
    <link rel='stylesheet' href='<%- rootUrl %>/node_modules/font-awesome/css/font-awesome.min.css' />
    <style>
        .fa {cursor:unset}
        .article-list { padding:0 12px 12px 0 }
        .article-list > div:first-child b, .appends-list > div:first-child b {color:#152138}
        .article-list > div { border-bottom:1px solid gainsboro;padding:12px 0;margin:0 12px }
        .article-list > div:first-child, .article-list > div:last-child { border-bottom:0 }
        .article-list > div > a > p:first-child {color:darkgrey;font-size:11px}
        .article-list > div > p:last-child { color:dimgrey; font-size:13px }
        .appends-list { border:1px solid gainsboro }
        .appends-list > div { padding:9px 12px }
        .appends-list > div:not(:first-child) {font-size:15px;text-indent:0.5em}
    </style>
    <script src="<%- rootUrl %>/res/adapter.js"></script>
</head>
<body class="body-nomargin">
<%- components['signhead'] ? include(components['signhead'], this) : '' %>
<div class="width-limit adapt-panel" style="padding-top:12px">
    <div class="adapt-two-left article-list">
        <div><b><i class="fa fa-bars"></i>&nbsp;历史列表</b><span style="margin-left:0.5em;font-size:0.8em"><input type="checkbox" value="article" checked />文章&nbsp;<input type="checkbox" value="comment" checked />评论&nbsp;<input type="checkbox" value="fond" checked />点赞</span></div>
        <% for (let history of historys){ %>
        <div>
            <a href="./article?id=<%- history.article._id %><%- history.type!=='文章'?'&path='+history.item.path:'' %>">
                <p><%- history.time %>&emsp;<%- history.type==='文章'?'发布/编辑的文章&nbsp;——&nbsp;'+history.article.title:'发布的'+history.type %></p>
                <p><%- history.item.brief %></p>
            </a>
            <p><a href="./article?id=<%- history.article._id %>">所在文章&nbsp;:&nbsp;<%- history.article.title %></a></p>
        </div>
        <% } %>
    </div>
    <div class="adapt-two-right" style="padding:0 6px 6px 6px">
        <% if (blockRoot==='' || blockRoot=='alljs'){ %>
        <div class=" appends-list" style="margin-top:24px">
            <div><b><i class="fa fa-external-link-square"></i>&nbsp;友情链接</b></div>
            <div><a href="javascript:window.open('https://github.com/')" ><span>Github</span></a></div>
            <div><a href="javascript:window.open('https://sourceforge.net/')" ><span>SourceForge</span></a></div>
            <div><a href="javascript:window.open('https://stackoverflow.com/')" ><span>Stack Overflow</span></a></div>
            <div><a href="javascript:window.open('https://msdn.microsoft.com/library/')" ><span>MSDN</span></a></div>
            <div><a href="javascript:window.open('https://www.npmjs.com/')" ><span>NPM</span></a></div>
            <div><a href="javascript:window.open('http://www.w3school.com.cn/')" ><span>W3school</span></a></div>
            <div><a href="javascript:window.open('https://www.runoob.com/')" ><span>菜鸟教程</span></a></div>
            <div><a href="javascript:window.open('https://www.csdn.net/')" ><span>CSDN</span></a></div>
            <div><a href="javascript:window.open('https://www.oschina.net/')" ><span>开源中国</span></a></div>
            <div><a href="javascript:window.open('https://www.bootcdn.cn/')" ><span>BootCDN</span></a></div>
            <div><a href="javascript:window.open('https://www.javascriptcn.com/')" ><span>JavaScript中文网</span></a></div>
            <div><a href="javascript:window.open('https://segmentfault.com/')" ><span>SegmentFault思否</span></a></div>
            <div><a href="javascript:window.open('http://ourjs.com/')" ><span>OurJS社区</span></a></div>
        </div>
        <% } %>
    </div>
</div>
<script>
document.body.onload = function(){
    var typeChecks = document.querySelectorAll('.article-list>div:first-child>span>input[type="checkbox"]');
    let cols = window.getUrlParam('cols');
    if (cols != null){
        cols = cols.split(',');
        typeChecks.forEach(check=>{
            if (cols.indexOf(check.value)<0)
                check.checked = false;
        });
    }
    typeChecks.forEach(p=>{
        p.onchange = function(e){
            let cols='';
            typeChecks.forEach(check=>{cols += check.checked ? (check.value + ',') : ''});
            if (cols[cols.length-1] === ',')
                cols = cols.substr(0, cols.length-1);
            window.location.href = './userHistory.html?cols='+cols;
        }
    });
}
</script>
</body>
</html>